package com.yanqu.road.entity.activity.tonbing.config;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.enums.activity.tonbing.eTonBingStage;
import com.yanqu.road.utils.date.DateHelper;
import com.yanqu.road.utils.string.StringUtils;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class TonBingConfig {

    private ActivityInfo activityInfo;

    // 道具
    private int ziZhongItem;                                                                // 辎重：兑换奖励
    private int zhanGongItem;                                                               // 战功：排行、成绩、兑换奖励
    private int shenXingItem;                                                               // 神行令：减少行军时间
    private int zhanGuItem;                                                                 // 战鼓：战斗加速
    private int bingFuItem;                                                                 // 兵符：招募士兵

    // 征兵
    private Map<Long, Long> recruitSoldierMap;                                              // 招募士兵，Map<每秒人数,每秒银两>
    private int barrackLimitParam;                                                          // 兵营上限参数

    // 战斗速度
    private long battleCostTime;                                                            // 战斗消耗时间
    private int battlefieldPartParam;                                                       // 分战场参数
    private long battlePrepareTime;                                                         // 战斗准备时间

    // 城池事件
    private List<Integer> cityEventConfigList;                                              // 城池事件池
    private List<Integer> cityEventInitConfigList;                                          // 事件初始城池，Map<城池ID，List<所属阵营>>
    private List<Long> cityEventRefreshTime;                                                // 城池事件刷新时间
    private List<Long> cityEventApplyTime;                                                  // 城池事件生效时间

    // 移动
    private long moveTime;                                                                  // 移动时间
    private long moveTimeFast;                                                              // 快速移动时间

    // 城防
    private String cityDefTeamNameKey;                                                      // 城防军名称的key，客户端拿他去找对应文本
    private long cityTeamRecoveryTime;                                                      // 城防军恢复时间

    // 医院伤兵
    private long woundedSoldierMaxNum;                                                      // 医院上限
    private long woundedSoldierPercent;                                                     // 伤兵转化比例
    private long woundedRescueTime;                                                         // 伤救治速度
    private long woundedRescueCount;                                                        // 伤救治数量
    private long redDotCureNum;                                                             // 伤兵红点所需可招募数量

    // npc事件
    private Map<Integer, TonBingNpcEventConfig> npcEventConfigMap;                         // npc事件，Map<事件ID，数据>
    private int npcEventMaxNum;                                                             // npc事件最大数量
    private long npcEventBeginTime;                                                         // npc事件每日生成开始时间
    private long npcEventInterval;                                                          // npc事件生成生成时间间隔
    private int npcEventDayMaxNum;                                                          // npc事件每日上限
    private int npcEventPositionNum;                                                        // npc事件位置个数

    // 城主
    private Map<Integer,Map<Integer, TonBingTitleConfig>> titleConfigMap;                   // 城主任命职位，Map<职位id，数据>
    private Map<Integer, List<Integer>> worshipRewardMap;                                   // 膜拜城主的奖励，Map<物品id，随机出来奖励的最大值和最小值两个数>
    private Map<Integer, List<Integer>> worshipRewardMap2;                                   // 膜拜皇帝
    private Map<Integer, List<Integer>> worshipRewardMap3;                                   // 膜拜排行榜
    private int winDecorationId;                                                            // 城主称号ID
    private String mailWinTitleReward;                                                        // 官职的称号邮件标题
    private String mailWinContentReward;                                                      // 官职的称号邮件内容
    private String mailFirstTitleReward;                                                      // 城主的称号邮件标题
    private String mailFirstContentReward;                                                    // 城主的称号邮件内容

    // 时间
    private List<Long> joinTimeList;                                                        // 报名时间    [开始时间，结束时间]
    private List<List<Long>> stage1TimeList;                                                // 第一阶段时间    [开始时间，结束时间] , [开始时间，结束时间] , ...
//    private long stage2BeginTime;                                                           // 第二阶段时间    [开始时间，结束时间]
    private Map<Integer,Long> stage2BeginTimeMap;                                            // 第二阶段时间    [开始时间，结束时间]
    private int warTypeCount;                                                                // 有几天就是几个战场

    // 队伍
    private int teamNum = 5;                                                                // 队伍数量，跟职业有关，写死5个
    private int teamMainPatronsNum = 1;                                                     // 主将数量，跟头像有关，写死1个
    private int teamAuxiliaryPatronsNum;                                                    // 副将数量
    private int teamOtherPatronsNum = 999;                                                  // 军需官数量，写死无上限

    // 阵营礼包
    private Map<Integer, TonBingCampBoxConfig> campBoxConfigMap;                           // 阵营宝箱

    // 报名
    private int campNum;                                                                    // 阵营数量
    private int unionNum;                                                                   // 参与活动商会数

    // 队伍带兵
    private List<Long> teamSoldierMaxNumParam;                                              // 队伍带兵上限
    private long teamNumLowerLimitParam;                                                    // 队伍带兵下限(千分比)
    private long teamNumLowerLimitFixedParam;                                               // 队伍带兵下限(固定值)
    private long syncPatronsCd;                                                             // 战力同步冷却时间

    // 战斗相关参数
    private List<Integer> battleParam;                                                      // 战斗参数
    private List<Integer> zhanGongParam;                                                    // 战功参数

    // 城池 warType cityId cityInfo
    private Map<Integer,Map<Integer, TonBingCityConfig>> cityConfigMap;                     // 城池，Map<城池ID，数据>
    // warType
    private Map<Integer,Map<Integer, TonBingCityTypeConfig>> cityTypeConfigMap;             // 城池类型
    private long redDotCollectCount;                                                        // 需要发红点的采集数量
    private String ziZhongTitle;                                                            // 辎重自动补发邮件标题
    private String ziZhongContent;                                                          // 辎重自动补发邮件内容
    private long appointScoreLimit;                                                         // 可任命指挥官的条件（阵营战功第一且战功>=xxxx）

    // 地图
    private Map<Integer, List<Integer>> cityConnectMap;                                     // 城池连接，Map<城池ID，相邻城池ID>

    // buff
    private Map<Integer, TonBingBuffTypeConfig> buffTypeConfigMap;                         // buff类型，Map<类型，数据>

    // 战报、公告
    private int cityReportNum;                                                              // 城池战报数量上限
    private int userReportNum;                                                              // 个人战报数量上限
    private int continueWinReportTimes;                                                     // 连胜公告所需次数
    private long needHelpCd;                                                                // 求援CD

    // 显示
    private int lightRankNum;                                                               // 排名前十发光
    private int showCampTopNum;                                                             // 每阵营排名前十显示
    private int showCampOutScreenNum;                                                       // 屏幕外每阵营队伍数量
    private int showCampInScreenNum;                                                        // 屏幕内每阵营队伍数量
    private long lightNeedZhanGong;                                                         // 发光所需积分

    private String skinsExchangeParam;                                                      // 服装兑换参数(服装ID#兑换所需战功值,限购数量,兑换道具=兑换道具数量)

    private String guildGroupRule; // 商会分组转换规则
    private String group; // 商会特殊分组范围

    private List<Integer> secondMatchRanges = new ArrayList<>(); // 商会特殊分组范围

    // ===================================================================================================

    private List<Integer> groupRuleList;//每轮晋级人数
    private int unionMax;//每一个分组的人数最大值

    private List<Integer> warTypeList;//每一轮的晋级战场

    public void setGroupRuleList(String infoStr){
        groupRuleList = StringUtils.stringToIntegerList(infoStr,"\\|");
    }

    public int getGroupRuleList(int turn) {
        if(turn - 1 < groupRuleList.size()){
            return groupRuleList.get(turn - 1);
        }
        return 0;
    }

    public int getUnionMax() {
        return unionMax;
    }

    public int getWarTypeCount() {
        return warTypeCount;
    }

    public void setWarTypeCount(int warTypeCount) {
        this.warTypeCount = warTypeCount;
    }

    //返回当前是第几天的
    public int getTurn(){
        long now = System.currentTimeMillis();
        for (int i = 0; i < stage1TimeList.size() ;i++) {
            if (now >= stage1TimeList.get(i).get(2) && now < stage1TimeList.get(i).get(3)) {
                return i + 1;
            }
        }
        return 0;
    }

    //获得最后一轮
    public int getLastTurn(){
        return stage1TimeList.size();
    }

    //获得最后的战场类型
    public int getLastWayType(){
        return warTypeList.get(warTypeList.size() - 1);
    }

    public void setUnionMax(int unionMax) {
        this.unionMax = unionMax;
    }

    public List<Integer> getWarTypeList() {
        return warTypeList;
    }

    public void setWarTypeList(List<Integer> warTypeList) {
        this.warTypeList = warTypeList;
    }

    //排行榜的对应轮次数据要开战了才显示
    public boolean isRankStartTime(int turn){
        if(turn == 0){
            return false;
        }
        long nowTime = System.currentTimeMillis();
        List<Long> list = stage1TimeList.get(turn - 1);
        if (nowTime >= list.get(0)) {
            return true;
        }
        return false;
    }
    /**
     * 获取当前阶段
     */
    public eTonBingStage getTonBingStage() {
        long now = System.currentTimeMillis();
        if (now < joinTimeList.get(0)) {
            return eTonBingStage.NoStart;
        }
        if (now < joinTimeList.get(1)) {
            return eTonBingStage.JoinTime;
        }
        if (now < stage1TimeList.get(0).get(0)) {
            return eTonBingStage.ReadyTime;
        }
        if (now < stage1TimeList.get(stage1TimeList.size() - 1).get(1)) {
            for (List<Long> list : stage1TimeList) {
                if (now >= list.get(0) && now < list.get(1)) {
                    return eTonBingStage.Stage1Time;
                }
            }
            return eTonBingStage.Stage1RestTime;
        }
        if (now < activityInfo.getEndTime() * 1000L) {
            return eTonBingStage.Stage1EndTime;
        }
        if (now < activityInfo.getEndTime() * 1000L + DateHelper.MINUTE_MILLIONS * 5) {
            return eTonBingStage.WaitRewardTime;
        }
        if (now < activityInfo.getEndShowTime() * 1000L) {
            return eTonBingStage.RewardTime;
        }
        return eTonBingStage.ActivityEndShow;
    }

    /**
     * 进入活动页面的时间内
     */
    public boolean inEnterActivityTime() {
        long now = System.currentTimeMillis();
        return now >= stage1TimeList.get(0).get(0) && now < activityInfo.getEndTime() * 1000L;
    }

    public boolean inShowActivityTime() {
        long now = System.currentTimeMillis();
        return now >= stage1TimeList.get(0).get(0) && now < activityInfo.getEndShowTime() * 1000L;
    }

    // ===================================================================================================


    public long getLightNeedZhanGong() {
        return lightNeedZhanGong;
    }

    public void setLightNeedZhanGong(long lightNeedZhanGong) {
        this.lightNeedZhanGong = lightNeedZhanGong;
    }

    public int getBarrackLimitParam() {
        return barrackLimitParam;
    }

    public void setBarrackLimitParam(int barrackLimitParam) {
        this.barrackLimitParam = barrackLimitParam;
    }

    public int getWinDecorationId() {
        return winDecorationId;
    }

    public void setWinDecorationId(int winDecorationId) {
        this.winDecorationId = winDecorationId;
    }

    public String getMailWinTitleReward() {
        return mailWinTitleReward;
    }

    public void setMailWinTitleReward(String mailWinTitleReward) {
        this.mailWinTitleReward = mailWinTitleReward;
    }

    public String getMailWinContentReward() {
        return mailWinContentReward;
    }

    public void setMailWinContentReward(String mailWinContentReward) {
        this.mailWinContentReward = mailWinContentReward;
    }

    public String getMailFirstTitleReward() {
        return mailFirstTitleReward;
    }

    public void setMailFirstTitleReward(String mailFirstTitleReward) {
        this.mailFirstTitleReward = mailFirstTitleReward;
    }

    public String getMailFirstContentReward() {
        return mailFirstContentReward;
    }

    public void setMailFirstContentReward(String mailFirstContentReward) {
        this.mailFirstContentReward = mailFirstContentReward;
    }


    public Map<Integer, Long> getStage2BeginTimeMap() {
        return stage2BeginTimeMap;
    }

    public void setStage2BeginTimeMap(Map<Integer, Long> stage2BeginTimeMap) {
        this.stage2BeginTimeMap = stage2BeginTimeMap;
    }

    public int getCityReportNum() {
        return cityReportNum;
    }

    public void setCityReportNum(int cityReportNum) {
        this.cityReportNum = cityReportNum;
    }

    public int getUserReportNum() {
        return userReportNum;
    }

    public void setUserReportNum(int userReportNum) {
        this.userReportNum = userReportNum;
    }

    public int getContinueWinReportTimes() {
        return continueWinReportTimes;
    }

    public void setContinueWinReportTimes(int continueWinReportTimes) {
        this.continueWinReportTimes = continueWinReportTimes;
    }

    public long getNeedHelpCd() {
        return needHelpCd;
    }

    public void setNeedHelpCd(long needHelpCd) {
        this.needHelpCd = needHelpCd;
    }

    public int getLightRankNum() {
        return lightRankNum;
    }

    public void setLightRankNum(int lightRankNum) {
        this.lightRankNum = lightRankNum;
    }

    public int getShowCampTopNum() {
        return showCampTopNum;
    }

    public void setShowCampTopNum(int showCampTopNum) {
        this.showCampTopNum = showCampTopNum;
    }

    public int getShowCampOutScreenNum() {
        return showCampOutScreenNum;
    }

    public void setShowCampOutScreenNum(int showCampOutScreenNum) {
        this.showCampOutScreenNum = showCampOutScreenNum;
    }

    public int getShowCampInScreenNum() {
        return showCampInScreenNum;
    }

    public void setShowCampInScreenNum(int showCampInScreenNum) {
        this.showCampInScreenNum = showCampInScreenNum;
    }

    public ActivityInfo getActivityInfo() {
        return activityInfo;
    }

    public int getZiZhongItem() {
        return ziZhongItem;
    }

    public int getZhanGongItem() {
        return zhanGongItem;
    }

    public int getShenXingItem() {
        return shenXingItem;
    }

    public int getZhanGuItem() {
        return zhanGuItem;
    }

    public int getBingFuItem() {
        return bingFuItem;
    }

    public Map<Long, Long> getRecruitSoldierMap() {
        return recruitSoldierMap;
    }

    public long getBattleCostTime() {
        return battleCostTime;
    }

    public List<Integer> getCityEventConfigList() {
        return cityEventConfigList;
    }

    public List<Integer> getCityEventInitConfigList() {
        return cityEventInitConfigList;
    }

    public void setCityEventInitConfigList(List<Integer> cityEventInitConfigList) {
        this.cityEventInitConfigList = cityEventInitConfigList;
    }

    public long getMoveTime() {
        return moveTime;
    }

    public long getWoundedSoldierMaxNum() {
        return woundedSoldierMaxNum;
    }

    public long getWoundedSoldierPercent() {
        return woundedSoldierPercent;
    }

    public long getWoundedRescueTime() {
        return woundedRescueTime;
    }

    public long getWoundedRescueCount() {
        return woundedRescueCount;
    }

    public Map<Integer, TonBingNpcEventConfig> getNpcEventConfigMap() {
        return npcEventConfigMap;
    }

    public int getNpcEventMaxNum() {
        return npcEventMaxNum;
    }

    public long getNpcEventBeginTime() {
        return npcEventBeginTime;
    }

    public long getNpcEventInterval() {
        return npcEventInterval;
    }

    public int getNpcEventDayMaxNum() {
        return npcEventDayMaxNum;
    }

    public int getNpcEventPositionNum() {
        return npcEventPositionNum;
    }

    public Map<Integer, Map<Integer, TonBingTitleConfig>> getTitleConfigMap() {
        return titleConfigMap;
    }

    public Map<Integer, List<Integer>> getWorshipRewardMap() {
        return worshipRewardMap;
    }


    public Map<Integer, List<Integer>> getWorshipRewardMap2() {
        return worshipRewardMap2;
    }

    public void setWorshipRewardMap2(Map<Integer, List<Integer>> worshipRewardMap2) {
        this.worshipRewardMap2 = worshipRewardMap2;
    }

    public Map<Integer, List<Integer>> getWorshipRewardMap3() {
        return worshipRewardMap3;
    }

    public void setWorshipRewardMap3(Map<Integer, List<Integer>> worshipRewardMap3) {
        this.worshipRewardMap3 = worshipRewardMap3;
    }

    public List<Long> getJoinTimeList() {
        return joinTimeList;
    }

    public List<List<Long>> getStage1TimeList() {
        return stage1TimeList;
    }

    public int getTeamNum() {
        return teamNum;
    }

    public int getTeamMainPatronsNum() {
        return teamMainPatronsNum;
    }

    public int getTeamAuxiliaryPatronsNum() {
        return teamAuxiliaryPatronsNum;
    }

    public int getTeamOtherPatronsNum() {
        return teamOtherPatronsNum;
    }

    public Map<Integer, TonBingCampBoxConfig> getCampBoxConfigMap() {
        return campBoxConfigMap;
    }

    public int getCampNum() {
        return campNum;
    }

    public int getUnionNum() {
        return unionNum;
    }

    public List<Long> getTeamSoldierMaxNumParam() {
        return teamSoldierMaxNumParam;
    }

    public long getTeamNumLowerLimitParam() {
        return teamNumLowerLimitParam;
    }

    public long getTeamNumLowerLimitFixedParam() {
        return teamNumLowerLimitFixedParam;
    }

    public List<Integer> getBattleParam() {
        return battleParam;
    }

    public List<Integer> getZhanGongParam() {
        return zhanGongParam;
    }

    public Map<Integer, TonBingCityConfig> getCityConfigMap(int warType) {
        return cityConfigMap.get(warType);
    }

    public Map<Integer, Map<Integer, TonBingCityConfig>> getCityConfigMap() {
        return cityConfigMap;
    }

    public Map<Integer, TonBingCityTypeConfig> getCityTypeConfigMap(int warType) {
        return cityTypeConfigMap.get(warType);
    }

    public Map<Integer,Map<Integer, TonBingCityTypeConfig>> getCityTypeConfigMap() {
        return cityTypeConfigMap;
    }

    //获得阵营积分 第几轮的
    public int getCityScore(int warType,int cityId,int turn){
        Map<Integer, TonBingCityConfig> cityConfigMap = getCityConfigMap(warType);
        Map<Integer, TonBingCityTypeConfig> cityTypeConfigMap = getCityTypeConfigMap(warType);
        if(cityConfigMap != null && cityTypeConfigMap != null){
            TonBingCityConfig cityConfig = cityConfigMap.get(cityId);
            if(cityConfig != null && cityTypeConfigMap.containsKey(cityConfig.getType())){
                int score = 0;
                List<Integer> campPointList = cityTypeConfigMap.get(cityConfig.getType()).getCampPointList();
                if(campPointList.size() >= turn){
                    score = campPointList.get(turn - 1);
                }else {
                    score = campPointList.get(0);
                }
                return score;
            }
        }
        return 0;
    }

    public Map<Integer, TonBingBuffTypeConfig> getBuffTypeConfigMap() {
        return buffTypeConfigMap;
    }

    // ===================================

    public void setActivityInfo(ActivityInfo activityInfo) {
        this.activityInfo = activityInfo;
    }

    public void setZiZhongItem(int ziZhongItem) {
        this.ziZhongItem = ziZhongItem;
    }

    public void setZhanGongItem(int zhanGongItem) {
        this.zhanGongItem = zhanGongItem;
    }

    public void setShenXingItem(int shenXingItem) {
        this.shenXingItem = shenXingItem;
    }

    public void setZhanGuItem(int zhanGuItem) {
        this.zhanGuItem = zhanGuItem;
    }

    public void setBingFuItem(int bingFuItem) {
        this.bingFuItem = bingFuItem;
    }

    public void setRecruitSoldierMap(Map<Long, Long> recruitSoldierMap) {
        this.recruitSoldierMap = recruitSoldierMap;
    }

    public void setBattleCostTime(long battleCostTime) {
        this.battleCostTime = battleCostTime;
    }

    public void setCityEventConfigList(List<Integer> cityEventConfigList) {
        this.cityEventConfigList = cityEventConfigList;
    }

    public List<Long> getCityEventRefreshTime() {
        return cityEventRefreshTime;
    }

    public void setCityEventRefreshTime(List<Long> cityEventRefreshTime) {
        this.cityEventRefreshTime = cityEventRefreshTime;
    }

    public List<Long> getCityEventApplyTime() {
        return cityEventApplyTime;
    }

    public void setCityEventApplyTime(List<Long> cityEventApplyTime) {
        this.cityEventApplyTime = cityEventApplyTime;
    }

    public void setMoveTime(long moveTime) {
        this.moveTime = moveTime;
    }

    public void setWoundedSoldierMaxNum(long woundedSoldierMaxNum) {
        this.woundedSoldierMaxNum = woundedSoldierMaxNum;
    }

    public void setWoundedSoldierPercent(long woundedSoldierPercent) {
        this.woundedSoldierPercent = woundedSoldierPercent;
    }

    public void setWoundedRescueTime(long woundedRescueTime) {
        this.woundedRescueTime = woundedRescueTime;
    }

    public void setWoundedRescueCount(long woundedRescueCount) {
        this.woundedRescueCount = woundedRescueCount;
    }

    public void setNpcEventConfigMap(Map<Integer, TonBingNpcEventConfig> npcEventConfigMap) {
        this.npcEventConfigMap = npcEventConfigMap;
    }

    public void setNpcEventMaxNum(int npcEventMaxNum) {
        this.npcEventMaxNum = npcEventMaxNum;
    }

    public void setNpcEventBeginTime(long npcEventBeginTime) {
        this.npcEventBeginTime = npcEventBeginTime;
    }

    public void setNpcEventInterval(long npcEventInterval) {
        this.npcEventInterval = npcEventInterval;
    }

    public void setNpcEventDayMaxNum(int npcEventDayMaxNum) {
        this.npcEventDayMaxNum = npcEventDayMaxNum;
    }

    public void setNpcEventPositionNum(int npcEventPositionNum) {
        this.npcEventPositionNum = npcEventPositionNum;
    }

    public void setTitleConfigMap(Map<Integer,Map<Integer, TonBingTitleConfig>> titleConfigMap) {
        this.titleConfigMap = titleConfigMap;
    }

    public void setWorshipRewardMap(Map<Integer, List<Integer>> worshipRewardMap) {
        this.worshipRewardMap = worshipRewardMap;
    }

    public void setJoinTimeList(List<Long> joinTimeList) {
        this.joinTimeList = joinTimeList;
    }

    public void setStage1TimeList(List<List<Long>> stage1TimeList) {
        this.stage1TimeList = stage1TimeList;
    }

    public void setTeamNum(int teamNum) {
        this.teamNum = teamNum;
    }

    public void setTeamMainPatronsNum(int teamMainPatronsNum) {
        this.teamMainPatronsNum = teamMainPatronsNum;
    }

    public void setTeamAuxiliaryPatronsNum(int teamAuxiliaryPatronsNum) {
        this.teamAuxiliaryPatronsNum = teamAuxiliaryPatronsNum;
    }

    public void setTeamOtherPatronsNum(int teamOtherPatronsNum) {
        this.teamOtherPatronsNum = teamOtherPatronsNum;
    }

    public void setCampBoxConfigMap(Map<Integer, TonBingCampBoxConfig> campBoxConfigMap) {
        this.campBoxConfigMap = campBoxConfigMap;
    }

    public void setCampNum(int campNum) {
        this.campNum = campNum;
    }

    public void setUnionNum(int unionNum) {
        this.unionNum = unionNum;
    }

    public void setTeamSoldierMaxNumParam(List<Long> teamSoldierMaxNumParam) {
        this.teamSoldierMaxNumParam = teamSoldierMaxNumParam;
    }

    public void setTeamNumLowerLimitParam(long teamNumLowerLimitParam) {
        this.teamNumLowerLimitParam = teamNumLowerLimitParam;
    }

    public void setTeamNumLowerLimitFixedParam(long teamNumLowerLimitFixedParam) {
        this.teamNumLowerLimitFixedParam = teamNumLowerLimitFixedParam;
    }

    public void setBattleParam(List<Integer> battleParam) {
        this.battleParam = battleParam;
    }

    public void setZhanGongParam(List<Integer> zhanGongParam) {
        this.zhanGongParam = zhanGongParam;
    }

    public void setCityConfigMap(Map<Integer,Map<Integer, TonBingCityConfig>> cityConfigMap) {
        this.cityConfigMap = cityConfigMap;
    }

    public void setCityTypeConfigMap(Map<Integer,Map<Integer, TonBingCityTypeConfig>> cityTypeConfigMap) {
        this.cityTypeConfigMap = cityTypeConfigMap;
    }

    public void setBuffTypeConfigMap(Map<Integer, TonBingBuffTypeConfig> buffTypeConfigMap) {
        this.buffTypeConfigMap = buffTypeConfigMap;
    }

    public Map<Integer, List<Integer>> getCityConnectMap() {
        return cityConnectMap;
    }

    public void setCityConnectMap(Map<Integer, List<Integer>> cityConnectMap) {
        this.cityConnectMap = cityConnectMap;
    }

    public int getBattlefieldPartParam() {
        return battlefieldPartParam;
    }

    public void setBattlefieldPartParam(int battlefieldPartParam) {
        this.battlefieldPartParam = battlefieldPartParam;
    }

    public long getBattlePrepareTime() {
        return battlePrepareTime;
    }

    public void setBattlePrepareTime(long battlePrepareTime) {
        this.battlePrepareTime = battlePrepareTime;
    }

    public long getSyncPatronsCd() {
        return syncPatronsCd;
    }

    public void setSyncPatronsCd(long syncPatronsCd) {
        this.syncPatronsCd = syncPatronsCd;
    }

    public String getCityDefTeamNameKey() {
        return cityDefTeamNameKey;
    }

    public void setCityDefTeamNameKey(String cityDefTeamNameKey) {
        this.cityDefTeamNameKey = cityDefTeamNameKey;
    }

    public long getRedDotCollectCount() {
        return redDotCollectCount;
    }

    public void setRedDotCollectCount(long redDotCollectCount) {
        this.redDotCollectCount = redDotCollectCount;
    }

    public long getCityTeamRecoveryTime() {
        return cityTeamRecoveryTime;
    }

    public void setCityTeamRecoveryTime(long cityTeamRecoveryTime) {
        this.cityTeamRecoveryTime = cityTeamRecoveryTime;
    }

    public long getRedDotCureNum() {
        return redDotCureNum;
    }

    public void setRedDotCureNum(long redDotCureNum) {
        this.redDotCureNum = redDotCureNum;
    }

    public long getMoveTimeFast() {
        return moveTimeFast;
    }

    public void setMoveTimeFast(long moveTimeFast) {
        this.moveTimeFast = moveTimeFast;
    }

    public String getZiZhongTitle() {
        return ziZhongTitle;
    }

    public void setZiZhongTitle(String ziZhongTitle) {
        this.ziZhongTitle = ziZhongTitle;
    }

    public String getZiZhongContent() {
        return ziZhongContent;
    }

    public void setZiZhongContent(String ziZhongContent) {
        this.ziZhongContent = ziZhongContent;
    }

    public long getAppointScoreLimit() {
        return appointScoreLimit;
    }

    public void setAppointScoreLimit(long appointScoreLimit) {
        this.appointScoreLimit = appointScoreLimit;
    }

    public String getSkinsExchangeParam() {
        return skinsExchangeParam;
    }

    public void setSkinsExchangeParam(String skinsExchangeParam) {
        this.skinsExchangeParam = skinsExchangeParam;
    }

    public List<Long> getGuildGroupRuleParams() {
        List<Long> res = new ArrayList<>();

        if (guildGroupRule.isEmpty()) {
            return res;
        }

        String[] params = guildGroupRule.split(";");
        for (String param : params) {
            res.add(Long.parseLong(param));
        }

        return res;
    }

    public void setGuildGroupRule(String guildGroupRule) {
        this.guildGroupRule = guildGroupRule;
    }

    public List<Integer> getGroupParams() {
        List<Integer> res = new ArrayList<>();

        if (group.isEmpty()) {
            return res;
        }

        String[] params = group.split(";");
        for (String param : params) {
            res.add(Integer.parseInt(param));
        }

        return res;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public List<Integer> secondMatchRanges() {
        return new ArrayList<>(secondMatchRanges);
    }

    public void setSecondMatchRanges(String secondMatchRanges) {
        this.secondMatchRanges = StringUtils.stringToIntegerList(secondMatchRanges, ";");
    }
}
